	* Stata replication code for U. Dasgupta, S. Mani, S. Sharma and S. Singhal
	* "Effects of Peers and Rank on Cognition, Preferences, and Personality"
	* Review of Economics and Statistics

	* Tables and figures in the main text and appendix
	
	version 14.2
	clear all
	set more off
	set matsize 11000
	capture log close

	*************************************************************************************************************

	** Between the quotation marks on the following line, replace XXXXXX with the full filepath to your working directory
	
	 gl dr = "/Users/saurabhsinghal/Dropbox/Delhi College Evaluation/Data/RESTAT_2020" // XXX
	 
	 
	*************************************************************************************************************
	
	 gl out = "$dr/output"
	 gl data = "$dr/data"
	 gl sample = "data/dmss_colsurvey.dta"
	 gl samplecutoffs = "$data/dmss_sample-cutoffs.dta"
	 gl hssurvey = "$data/dmss_hs_survey.dta"
	 gl enrolldata = "$data/dmss_enrolled.dta"
	 gl ravendata = "data/dmss_raven.dta"
	 gl cutoffdata = "data/dmss_cutoffs.dta"
	 
	 
	 cd "$dr"
	 
	 
	
	local coglist sem_avmarks  
	local behavlist z_compete z_over_conf z_pr_riskamt 
	local traitlist  z_tipi_extraversion z_tipi_agree z_tipi_consc z_tipi_emotion z_tipi_openexp 
	local control age hindu  private_school lowinc mod_edu_moth mod_edu_fath 	
	
	
	use "$sample" , clear
	
	
	*For all figures in the main paper
	do "_DMSS_main_figures.do"
	
	*For all tables in the main paper
	do "_DMSS_main_tables.do"
	
	*For all figures in the Appendix
	do "_DMSS_appendix_figures.do"
	
	*For all tables in the Appendix
	do "_DMSS_appendix_tables.do"
	
